import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class demo1 {
    public static boolean is_lun(int year) {
        return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
    }
    public static int Countofyear(int year) {
        if (is_lun(year)) {
            return 2 * 31 + 1 * 29 + 1 * 31 + 2 * 30 + 1 * 31 + 2 * 30 + 1 * 31 + 2 * 31 + 2
                    * 30 + 2 * 31 + 1 * 30 + 2 * 31;
        } else {
            return 2 * 31 + 1 * 28 + 1 * 31 + 2 * 30 + 1 * 31 + 2 * 30 + 1 * 31 + 2 * 31 + 2
                    * 30 + 2 * 31 + 1 * 30 + 2 * 31;
        }

    }
    public static int Countofday(int year, int month, int day) {
        int count = 0;
        switch (month) {
            case 1:
                count = day * 2;
                break;
            case 2:
                count = 31 * 2 + day * 1;
                break;
            case 3:
                count = 31 * 2 + 1 * 28 + day * 1;
                break;
            case 4:
                count = 31 * 2 + 1 * 28 + 31 * 1 + day * 2;
                break;
            case 5:
                count = 31 * 2 + 1 * 28 + 31 * 1 + 30 * 2 + day * 1;
                break;
            case 6:
                count = 31 * 2 + 1 * 28 + 31 * 1 + 30 * 2 + 31 * 1 + day * 2;
                break;
            case 7:
                count = 31 * 2 + 1 * 28 + 31 * 1 + 30 * 2 + 31 * 1 + 30 * 2 + day * 1;
                break;
            case 8:
                count = 31 * 2 + 1 * 28 + 31 * 1 + 30 * 2 + 31 * 1 + 30 * 2 + 31 * 1 + day * 2;
                break;
            case 9:
                count = 31 * 2 + 1 * 28 + 31 * 1 + 30 * 2 + 31 * 1 + 30 * 2 + 31 * 1 + 31 * 2 +
                        day * 2;
                break;
            case 10:
                count = 31 * 2 + 1 * 28 + 31 * 1 + 30 * 2 + 31 * 1 + 30 * 2 + 31 * 1 + 31 * 2 +
                        30 * 2 + day * 2;
                break;
            case 11:
                count = 31 * 2 + 1 * 28 + 31 * 1 + 30 * 2 + 31 * 1 + 30 * 2 + 31 * 1 + 31 * 2 +
                        30 * 2 + 31 * 2 + day * 1;
                break;
            case 12:
                count = 31 * 2 + 1 * 28 + 31 * 1 + 30 * 2 + 31 * 1 + 30 * 2 + 31 * 1 + 31 * 2 +
                        30 * 2 + 31 * 2 + 30 * 1 + day * 2;
                break;
        }
        if (is_lun(year) && month > 2) {
            count += 1;
        }
        return count;
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) {
            String s = in.nextLine();
            String[] ss = s.split(" ");
            int y1 = Integer.parseInt(ss[0]);
            int y2 = Integer.parseInt(ss[3]);
            int m1 = Integer.parseInt(ss[1]);
            int m2 = Integer.parseInt(ss[4]);
            int d1 = Integer.parseInt(ss[2]);
            int d2 = Integer.parseInt(ss[5]);
            int ret = 0;
            if (y1 == y2) {
                ret = Countofday(y2, m2, d2) - Countofday(y1, m1, d1-1);
            } else {
                ret = Countofday(y2, m2, d2) - Countofday(y1, m1, d1-1);
                for (int i = y1; i < y2; i++) {
                    ret += Countofyear(i);
                }
            }
            System.out.println(ret);
        }
    }
}